package com.gitee.wsl.common.ui.draw.api


interface HasTransform {
    val transform: Transform?
}

/**
 * Indicate an element on which we can apply a Transformation.
 * todo implement other transformation (rotate, ...)
 */
 class Transform {

     val transformations: List<AtomicTransformation>
        get() = _transformations

    private val _transformations = mutableListOf<AtomicTransformation>()

     fun translate(x: Double = 0.0, y: Double = 0.0) {
        _transformations.add(Translation(x, y))
    }

     fun rotate(delta: Double) {
        _transformations.add(Rotation(delta))
    }

}

 interface AtomicTransformation

 data class Translation(var x: Double = 0.0, var y: Double = 0.0): AtomicTransformation

 data class Rotation(var delta: Double = 0.0): AtomicTransformation


